package 力扣._00周赛._116双周赛.问题2;

import java.util.LinkedList;
import java.util.List;

public class Solution {
    public int minChanges(String s) {
        int t = 1;
        int sum = 0;
        for (int i = 1; i < s.length(); i++) {
            if (s.charAt(i) == s.charAt(i - 1))
                t++;
            else {
                //
                if (t % 2 != 0) {
                    sum++;
                    t = 2;
                } else
                    t = 1;
            }
        }
        return sum;

    }

    public static void main(String[] args) {
        int i = new Solution().minChanges("11000111");
        System.out.println(i);

    }
}
